package com.javalab._6feature._4exception;

/**
 * 代码中用throw抛出异常，常用来做校验
 */
public class _1Throw {

    public static void main(String[] args) {
        divideZero(1, 0);
    }

    private static int divideZero(int a , int b) {
        if(b==0) {
            //非法场景，抛出具体问题，编译时不检测
            throw new ArithmeticException("异常信息：除数不能为0");
        }
        return a / b;
    }
}
